package com.health.service.impl;

import com.health.entity.TRolePermision;
import com.health.mapper.TRolePermisionMapper;
import com.health.service.ITRolePermisionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author sanchuan
 * @since 2023-04-21
 */
@Service
public class TRolePermisionServiceImpl extends ServiceImpl<TRolePermisionMapper, TRolePermision> implements ITRolePermisionService {
    @Autowired
    private TRolePermisionMapper rolePermisionMapper;

    /**
     * 添加角色权限
     * @param checkPermissions
     * @param id
     * @return
     */
    @Override
    public Boolean addPermissionsStatus(List<Integer> checkPermissions, Integer id) {
        return  rolePermisionMapper.addPermissionsStatus(checkPermissions,id);
    }

    /**
     * 删除角色权限
     * @param checkPermissions
     * @param id
     * @return
     */
    @Override
    public Boolean deletePermissionsStatus(List<Integer> checkPermissions, Integer id) {
        return  rolePermisionMapper.deletePermissionsStatus(checkPermissions,id);
    }

    /**
     * 添加单个权限
     * @param delId
     * @param id
     * @return
     */
    @Override
    public Boolean addSinglePermissionsStatus(Integer delId, Integer id) {
        return rolePermisionMapper.addSinglePermissionsStatus(delId,id);
    }

    /**
     * 删除单个权限
     * @param delId
     * @param id
     * @return
     */
    @Override
    public Boolean deleteSinglePermissionsStatus(Integer delId, Integer id) {
        return rolePermisionMapper.deleteSinglePermissionsStatus(delId,id);
    }
}
